package com.ruoyi.finance.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.finance.mapper.WSupplierManagementMapper;
import com.ruoyi.finance.domain.WSupplierManagement;
import com.ruoyi.finance.service.IWSupplierManagementService;

/**
 * 供应商Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-03-04
 */
@Service
public class WSupplierManagementServiceImpl implements IWSupplierManagementService 
{
    @Autowired
    private WSupplierManagementMapper wSupplierManagementMapper;

    /**
     * 查询供应商
     * 
     * @param id 供应商主键
     * @return 供应商
     */
    @Override
    public WSupplierManagement selectWSupplierManagementById(Long id)
    {
        return wSupplierManagementMapper.selectWSupplierManagementById(id);
    }

    /**
     * 查询供应商列表
     * 
     * @param wSupplierManagement 供应商
     * @return 供应商
     */
    @Override
    public List<WSupplierManagement> selectWSupplierManagementList(WSupplierManagement wSupplierManagement)
    {
        return wSupplierManagementMapper.selectWSupplierManagementList(wSupplierManagement);
    }

    /**
     * 新增供应商
     * 
     * @param wSupplierManagement 供应商
     * @return 结果
     */
    @Override
    public int insertWSupplierManagement(WSupplierManagement wSupplierManagement)
    {
        wSupplierManagement.setCreateTime(DateUtils.getNowDate());
        return wSupplierManagementMapper.insertWSupplierManagement(wSupplierManagement);
    }

    /**
     * 修改供应商
     * 
     * @param wSupplierManagement 供应商
     * @return 结果
     */
    @Override
    public int updateWSupplierManagement(WSupplierManagement wSupplierManagement)
    {
        wSupplierManagement.setUpdateTime(DateUtils.getNowDate());
        return wSupplierManagementMapper.updateWSupplierManagement(wSupplierManagement);
    }

    /**
     * 批量删除供应商
     * 
     * @param ids 需要删除的供应商主键
     * @return 结果
     */
    @Override
    public int deleteWSupplierManagementByIds(Long[] ids)
    {
        return wSupplierManagementMapper.deleteWSupplierManagementByIds(ids);
    }

    /**
     * 删除供应商信息
     * 
     * @param id 供应商主键
     * @return 结果
     */
    @Override
    public int deleteWSupplierManagementById(Long id)
    {
        return wSupplierManagementMapper.deleteWSupplierManagementById(id);
    }
}
